package com.two.service.upload.controller;

import com.two.common.util.CommonResult;
import com.two.common.util.OSSUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/upload")
public class UploadController {
    @PostMapping("/upload")
    public CommonResult upload(MultipartFile file){
        String path= OSSUtils.upload(file);

        return new CommonResult(2000,"上传成功",path);
    }
}
